//
//  NIInfoCheckView.m
//  AIWAYS
//
//  Created by 王 立琼 on 2018/6/14.
//  Copyright © 2018年 wlq. All rights reserved.
//

#import "NIInfoCheckView.h"
#import "ColorDefine.h"
@implementation NIInfoCheckView
{
    IBOutlet UIView *contentView;
    IBOutlet UIImageView *imageView;
    IBOutlet UILabel *titleLabel;
    IBOutlet UILabel *detailFirstlineLabel;
    IBOutlet UILabel *detailSecondlineLabel;
    

}
-(void)awakeFromNib{
    [super awakeFromNib];
    [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:self options:nil];
    
    [self addSubview:contentView];
    
    contentView.translatesAutoresizingMaskIntoConstraints = NO;
    [self addConstraint:[NSLayoutConstraint constraintWithItem:contentView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]];
    [self addConstraint:[NSLayoutConstraint constraintWithItem:contentView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]];
    
    [self addConstraint:[NSLayoutConstraint constraintWithItem:contentView attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeading multiplier:1.0 constant:0]];
    [self addConstraint:[NSLayoutConstraint constraintWithItem:contentView attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTrailing multiplier:1.0 constant:0]];
    
    
}
-(void)setReviewStatus:(ReviewStatus)status message:(NSString *)message
{
    switch (status) {
        case UN_REVIEW:
            imageView.image = [UIImage imageNamed:@"personal_progress"];
            titleLabel.text = @"待审核";
            detailFirstlineLabel.text = message;
            detailFirstlineLabel.textColor = UIColorFromHex(0xF47777,1);
            break;
        case REVIEW_PROCESS:
            imageView.image = [UIImage imageNamed:@"personal_progress"];
            titleLabel.text = @"审核中";
            detailFirstlineLabel.text = message;
            detailFirstlineLabel.textColor = UIColorFromHex(0xF47777,1);
            break;
        case NOT_PASS:
            imageView.image = [UIImage imageNamed:@"personal_fail"];
            titleLabel.text = @"认证失败";
            detailFirstlineLabel.text = message;
            detailFirstlineLabel.textColor = UIColorFromHex(0xF47777,1);

            break;
        case PASSED:
            imageView.image = [UIImage imageNamed:@"personal_success"];
            titleLabel.text = @"认证成功";
            detailFirstlineLabel.text = message;
            detailSecondlineLabel.text = @"我们对您的信息进行了加密处理";
            detailFirstlineLabel.textColor = UIColorFromHex(0x0BC22A,1);
            detailSecondlineLabel.textColor = UIColorFromHex(0x0BC22A,1);

            break;
        case BINDING_VEHICLE_PROCESS:
            imageView.image = [UIImage imageNamed:@"personal_progress"];
            titleLabel.text = @"待确认";
            detailFirstlineLabel.text = @"";
            detailSecondlineLabel.text = @"";
            detailFirstlineLabel.textColor = UIColorFromHex(0x0BC22A,1);
            detailSecondlineLabel.textColor = UIColorFromHex(0x0BC22A,1);
            
            break;
            
        default:
            break;
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
